<?php

use Hyperf\Database\Schema\Schema;
use Hyperf\Database\Schema\Blueprint;
use Hyperf\Database\Migrations\Migration;

class AlterStatDailyHostInfoTable extends Migration
{
    protected $connection = 'stat';

    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::table('stat_daily_host_info', function (Blueprint $table) {
            $table->unsignedMediumInteger('online_time')->default(0)->comment('在线时长（累计）');
            $table->unsignedSmallInteger('video_answer_time')->default(0)->comment('视频接听时长');
            $table->unsignedSmallInteger('video_answer_num')->default(0)->comment('视频接听数');
            $table->unsignedSmallInteger('video_call_num')->default(0)->comment('主动拨打次数');
            $table->unsignedSmallInteger('video_match_num')->default(0)->comment('主动速配次数');
            $table->unsignedSmallInteger('super_chat_num')->default(0)->comment('主动搭讪人数');
            $table->double('msg_back_rate', 3, 1)->default(0.0)->comment('私信回复率');
            $table->double('success_rate', 3, 1)->default(0.0)->comment('成功接通率');
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::table('stat_daily_host_info', function (Blueprint $table) {
            //
        });
    }
}
